#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author   : Moty
# @Time     : 2024/1/22 0:12
# @File     : jt808_8105.py
# @Project  : jt808
def parse_device_control(body):
    # 解析0x8105终端控制
    data = {
        "命令字": parse_8105_command_argument(int(body[0:2])),
        "命令参数": body[2:],
        # 消息体为空
    }
    formatted_data = ""
    for key, value in data.items():
        formatted_data += f"{key}: {value}\n"
    return formatted_data


def parse_8105_command_argument(result_value):
    results = ['不支持', '控制终端连接指定服务器', '不支持', '终端复位', '终端恢复出厂设置', '不支持', '不支持']
    if 0 <= result_value < len(results):
        return results[result_value]
    else:
        return '未知结果'


__all__ = ['parse_device_control']